package screen
{
	import flash.display.Loader;
	import flash.display.MovieClip;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.net.URLRequest;

	public class LoadingScreen extends Sprite
	{
		private var asset:Sprite;
		
		public function LoadingScreen( asset:Sprite )
		{
			this.asset = asset;
			
			var loader:Loader = new Loader();
			this.addChild( loader );
			var mRequest:URLRequest = new URLRequest("Board.swf");
			
			loader.load( mRequest );
			loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoaded);
		}
		
		public function onLoaded( event:Event ):void
		{
			var ClassDefinition:Class = event.target.applicationDomain.getDefinition("Loading") as Class;
			var mc:MovieClip = new ClassDefinition();
			this.asset.addChild( mc );
			//this.asset.loadAnotherScreen
			//this.parent.removeChild(this);
		}
	}
}